#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	char c[100] = {0};
	int n;
	scanf("%d", &n);
	int sum = 0;
	int top = 0;
	while (n > 0)
	{
		c[top] = n % 10 + '0';
		sum++;
		if (sum == 3 && n/10!=0)
		{
			top++;
			c[top] = ',';
			top++;
			sum = 0;
		}
		else top++;
		n /= 10;
	}
	_strrev(c);
	printf("%s", c);
}